<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%>

<script>

    function saveInsService(urls){

        if($("#max_amount").val() != null && $("#max_amount").val() != "" && $("#max_amount").val() != parseFloat(0.00)
            && $("#min_amount").val()!=null && $("#min_amount").val()!="" && $("#min_amount").val() != parseFloat(0.00)
            && parseFloat($("#min_amount").val()) > parseFloat($("#max_amount").val())){
            $.jpmessage.info('最小金额不应大于最大金额');
            return;
        }
        if($("#debit_maxfee1").val() != null
            && $("#debit_maxfee1").val() != ""
            && $("#debit_minfee1").val()!=null
            && $("#debit_maxfee1").val() != parseFloat(0.00)
            && $("#debit_minfee1").val()!=""
            && $("#debit_minfee1").val() != parseFloat(0.00)
            && parseFloat($("#debit_minfee1").val()) > parseFloat($("#debit_maxfee1").val())){
            $.jpmessage.info('实名认证-借记卡最大手续费不能小于最小手续费!');
            return;
        }
        if($("#debit_maxfee2").val() != null
            && $("#debit_maxfee2").val() != ""
            && $("#debit_maxfee2").val() != parseFloat(0.00)
            && $("#debit_minfee2").val()!=null
            && $("#debit_minfee2").val()!=""
            && $("#debit_minfee2").val() != parseFloat(0.00)
            && parseFloat($("#debit_minfee2").val()) > parseFloat($("#debit_maxfee2").val())){
            $.jpmessage.info('VIP认证-借记卡最大手续费不能小于最小手续费!');
            return;
        }
        if($("#signal_maxamt").val() != null
            && $("#signal_maxamt").val() != ""
            && $("#signal_maxamt").val() != parseFloat(0.00)
            && $("#signal_minamt").val()!=null
            && $("#signal_minamt").val()!=""
            && $("#signal_minamt").val() != parseFloat(0.00)
            && parseFloat($("#signal_minamt").val()) > parseFloat($("#signal_maxamt").val())){
            $.jpmessage.info('实名认证-借记卡单笔最大限额不能小于单笔最小限额!');
            return;
        }
        if($("#vipsignal_maxamt").val() != null
            && $("#vipsignal_maxamt").val() != ""
            && $("#vipsignal_maxamt").val() != parseFloat(0.00)
            && $("#vipsignal_minamt").val()!=null
            && $("#vipsignal_minamt").val()!=""
            && $("#vipsignal_minamt").val() != parseFloat(0.00)
            && parseFloat($("#vipsignal_minamt").val()) > parseFloat($("#vipsignal_maxamt").val())){
            $.jpmessage.info('VIP认证-借记卡单笔最大限额不能小于单笔最小限额!');
            return;
        }
        // url : /insServiceParam/saveInsServiceParam.do

        if($("#insServiceParamForm").form("validate")){
            var options ={
                url:urls,
                type:'post',
                success : function(data){
                    if("success" == data.code){
                        $.jpmessage.info(data.message);
                    }else if("error" == data.code){
                        $.jpmessage.error(data.message);
                    }
                }
            };
            $("#insServiceParamForm").ajaxSubmit(options);
        }

    }

    $(document).ready(function() {
        $(".hide").parent().css("display", "none");
    });

</script>



<div class="easyui-panel" style="width:98%;">
    <div style="padding:10px 10px 10px 10px">
        <form id="insServiceParamForm"  name="InsServiceParamForm" method="post">
            <input type="hidden" id="ins_uuid" name="ins_uuid" value="${ins_uuid}"/>
            <input type="hidden" id="service_uuid" name="service_uuid" value="${service_uuid}"/>
            <input type="hidden" id="service_param_uuid" name="service_param_uuid" value="${service_param_uuid}"/>
            <input type="hidden" name="appInsServiceParamEntity1.ins_param_uuid" value="${appInsServiceParamEntity1.ins_param_uuid}"/>
            <input type="hidden" name="appInsServiceParamEntity1.rec_id" value="${appInsServiceParamEntity1.rec_id}"/>
            <input type="hidden" name="appInsServiceParamEntity2.ins_param_uuid" value="${appInsServiceParamEntity2.ins_param_uuid}"/>
            <input type="hidden" name="appInsServiceParamEntity2.rec_id" value="${appInsServiceParamEntity2.rec_id}"/>
            <input type="hidden" name="appInsParamLimitEntity12.ins_pur_limit_uuid" value="${appInsParamLimitEntity12.ins_pur_limit_uuid}"/>
            <input type="hidden" name="appInsParamLimitEntity12.rec_id" value="${appInsParamLimitEntity12.rec_id}"/>
            <input type="hidden" name="appInsParamLimitEntity11.ins_pur_limit_uuid" value="${appInsParamLimitEntity11.ins_pur_limit_uuid}"/>
            <input type="hidden" name="appInsParamLimitEntity11.rec_id" value="${appInsParamLimitEntity11.rec_id}"/>
            <input type="hidden" name="appInsParamLimitEntity22.ins_pur_limit_uuid" value="${appInsParamLimitEntity22.ins_pur_limit_uuid}"/>
            <input type="hidden" name="appInsParamLimitEntity22.rec_id" value="${appInsParamLimitEntity22.rec_id}"/>
            <input type="hidden" name="appInsParamLimitEntity21.ins_pur_limit_uuid" value="${appInsParamLimitEntity21.ins_pur_limit_uuid}"/>
            <input type="hidden" name="appInsParamLimitEntity21.rec_id" value="${appInsParamLimitEntity21.rec_id}"/>
            <div class="easyui-panel hide" title="贷记卡扣率" style="width:100%;height:245px;padding:5px;" data-options="collapsible:true">
                <table cellpadding="5" style="width:100%">
                    <tr>
                        <td><strong>实名认证-贷记卡</strong></td>
                    </tr>
                    <tr>
                        <td>扣率(万分位):</td>
                        <td><input class="easyui-numberspinner" name="appInsServiceParamEntity1.credit_rate" data-options="precision:0,min:0,max:10000" value="${appInsServiceParamEntity1.credit_rate}"></input></td>
                        <td>附加手续费:</td>
                        <td><input class="easyui-numberspinner" name="appInsServiceParamEntity1.credit_attachfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsServiceParamEntity1.credit_attachfee}"></input></td>
                    </tr>
                    <tr>
                        <td>最小手续费:</td>
                        <td><input class="easyui-numberspinner"  name="appInsServiceParamEntity1.credit_minfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsServiceParamEntity1.credit_minfee}"></input></td>
                        <td>最大手续费:</td>
                        <td><input class="easyui-numberspinner"  name="appInsServiceParamEntity1.credit_maxfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsServiceParamEntity1.credit_maxfee}"></input></td>
                    </tr>
                    <tr>
                        <td><strong>VIP认证-贷记卡</strong></td>
                    </tr>
                    <tr>
                        <td>扣率(万分位):</td>
                        <td><input class="easyui-numberspinner" name="appInsServiceParamEntity2.credit_rate" data-options="precision:0,min:0,max:10000" value="${appInsServiceParamEntity2.credit_rate}"></input></td>
                        <td>附加手续费:</td>
                        <td><input class="easyui-numberspinner" name="appInsServiceParamEntity2.credit_attachfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsServiceParamEntity2.credit_attachfee}"></input></td>
                    </tr>
                    <tr>
                        <td>最小手续费:</td>
                        <td><input class="easyui-numberspinner" name="appInsServiceParamEntity2.credit_minfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsServiceParamEntity2.credit_minfee}"></input></td>
                        <td>最大手续费:</td>
                        <td><input class="easyui-numberspinner" name="appInsServiceParamEntity2.credit_maxfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsServiceParamEntity2.credit_maxfee}"></input></td>
                    </tr>
                </table>
            </div>
            <div class="easyui-panel" title="借记卡扣率" style="width:100%;height:245px;padding:5px;" data-options="collapsible:true">
                <table cellpadding="5" style="width:100%">
                    <tr>
                        <td><strong>实名认证-借记卡</strong></td>
                    </tr>
                    <tr>
                        <td>扣率(万分位):</td>
                        <td><input class="easyui-numberspinner" name="appInsServiceParamEntity1.debit_rate" data-options="precision:0,min:0,max:10000" value="${appInsServiceParamEntity1.debit_rate}"></input></td>
                        <td>附加手续费(元):</td>
                        <td><input class="easyui-numberspinner" name="appInsServiceParamEntity1.debit_attachfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsServiceParamEntity1.debit_attachfee}"></input></td>
                    </tr>
                    <tr>
                        <td>最小手续费(元):</td>
                        <td><input class="easyui-numberspinner" id="debit_minfee1" name="appInsServiceParamEntity1.debit_minfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsServiceParamEntity1.debit_minfee}"></input></td>
                        <td>最大手续费(元):</td>
                        <td><input class="easyui-numberspinner" id="debit_maxfee1" name="appInsServiceParamEntity1.debit_maxfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsServiceParamEntity1.debit_maxfee}"></input></td>
                    </tr>
                    <tr>
                        <td><strong>VIP认证-借记卡</strong></td>
                    </tr>
                    <tr>
                        <td>扣率(万分位):</td>
                        <td><input class="easyui-numberspinner" name="appInsServiceParamEntity2.debit_rate" data-options="precision:0,min:0,max:10000" value="${appInsServiceParamEntity2.debit_rate}"></input></td>
                        <td>附加手续费(元):</td>
                        <td><input class="easyui-numberspinner" name="appInsServiceParamEntity2.debit_attachfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsServiceParamEntity2.debit_attachfee}"></input></td>
                    </tr>
                    <tr>
                        <td>最小手续费(元):</td>
                        <td><input class="easyui-numberspinner" id="debit_minfee2" name="appInsServiceParamEntity2.debit_minfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsServiceParamEntity2.debit_minfee}"></input></td>
                        <td>最大手续费(元):</td>
                        <td><input class="easyui-numberspinner" id="debit_maxfee2" name="appInsServiceParamEntity2.debit_maxfee" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsServiceParamEntity2.debit_maxfee}"></input></td>
                    </tr>
                </table>
            </div>
            <div class="easyui-panel" title="App输入金额限制" style="width:100%;height:120px;padding:5px;" data-options="collapsible:true">
                <table cellpadding="5" style="width:100%">
                    <tr>
                        <td>默认金额(元):</td>
                        <td><input class="easyui-numberspinner" name="default_amount" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsServiceParamEntity1.default_amount}"></input></td>
                    </tr>
                    <tr>
                        <td>最小金额(元):</td>
                        <td><input class="easyui-numberspinner" id="min_amount" name="min_amount" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsServiceParamEntity1.min_amount}"></input></td>
                        <td>最大金额(元):</td>
                        <td><input class="easyui-numberspinner" id="max_amount" name="max_amount" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsServiceParamEntity1.max_amount}"></input></td>

                    </tr>
                </table>
            </div>
            <div class="easyui-panel" title="时间限制" style="width:100%;height:120px;padding:5px;" data-options="collapsible:true">
                <table cellpadding="5" style="width:100%">
                    <tr>
                        <td>开始日期:</td>
                        <td><input id="begdate" type="text" name="begdate" class="easyui-datebox" value="${appInsServiceParamEntity1.begdate}"></td>
                        <td>每天开始时间:</td>
                        <td><input id="begtime" name="begtime" class="easyui-timespinner" style="width:80px;" data-options="min:'00:00:00',max:'23:59:59',showSeconds:true" value="${appInsServiceParamEntity1.begtime}"></td>
                    </tr>
                    <tr>
                        <td>结束日期:</td>
                        <td><input id="enddate" type="text" name="enddate" class="easyui-datebox" value="${appInsServiceParamEntity1.enddate}"></td>
                        <td>每天结束时间:</td>
                        <td><input id="endtime" name="endtime" class="easyui-timespinner" style="width:80px;" data-options="min:'00:00:00',max:'23:59:59',showSeconds:true" value="${appInsServiceParamEntity1.endtime}"></td>
                    </tr>
                </table>
            </div>
            <div class="easyui-panel" title="限额信息" style="width:100%;height:320px;padding:5px;" data-options="collapsible:true">
                <table cellpadding="5" style="width:100%">

                    <tr>
                        <td><strong>实名认证-借记卡</strong></td>
                    </tr>
                    <tr>
                        <td>单笔最小限额(元):</td>
                        <td><input class="easyui-numberspinner" id="signal_minamt" name="appInsParamLimitEntity11.signal_minamt" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsParamLimitEntity11.signal_minamt}"></input></td>
                        <td>单笔最大限额(元):</td>
                        <td><input class="easyui-numberspinner" id="signal_maxamt" name="appInsParamLimitEntity11.signal_maxamt" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsParamLimitEntity11.signal_maxamt}"></input></td>
                    </tr>
                    <tr>
                        <td>会员当日交易次数:</td>
                        <td><input class="easyui-numberspinner" name="appInsParamLimitEntity11.day_num" data-options="precision:0,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsParamLimitEntity11.day_num}"></input></td>
                        <td>会员当日交易限额(元):</td>
                        <td><input class="easyui-numberspinner" name="appInsParamLimitEntity11.day_amt" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsParamLimitEntity11.day_amt}"></input></td>
                    </tr>
                    <tr>
                        <td>会员当月交易次数:</td>
                        <td><input class="easyui-numberspinner" name="appInsParamLimitEntity11.mon_num" data-options="precision:0,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsParamLimitEntity11.mon_num}"></input></td>
                        <td>会员当月交易限额(元):</td>
                        <td><input class="easyui-numberspinner" name="appInsParamLimitEntity11.mon_amt" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsParamLimitEntity11.mon_amt}"></input></td>
                    </tr>

                    <tr>
                        <td><strong>VIP认证-借记卡</strong></td>
                    </tr>
                    <tr>
                        <td>单笔最小限额(元):</td>
                        <td><input class="easyui-numberspinner" id="vipsignal_minamt" name="appInsParamLimitEntity21.signal_minamt" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsParamLimitEntity21.signal_minamt}"></input></td>
                        <td>单笔最大限额(元):</td>
                        <td><input class="easyui-numberspinner" id="vipsignal_maxamt" name="appInsParamLimitEntity21.signal_maxamt" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsParamLimitEntity21.signal_maxamt}"></input></td>
                    </tr>
                    <tr>
                        <td>会员当日交易次数:</td>
                        <td><input class="easyui-numberspinner" name="appInsParamLimitEntity21.day_num" data-options="precision:0,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsParamLimitEntity21.day_num}"></input></td>
                        <td>会员当日交易限额(元):</td>
                        <td><input class="easyui-numberspinner" name="appInsParamLimitEntity21.day_amt" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsParamLimitEntity21.day_amt}"></input></td>
                    </tr>
                    <tr>
                        <td>会员当月交易次数:</td>
                        <td><input class="easyui-numberspinner" name="appInsParamLimitEntity21.mon_num" data-options="precision:0,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsParamLimitEntity21.mon_num}"></input></td>
                        <td>会员当月交易限额(元):</td>
                        <td><input class="easyui-numberspinner" name="appInsParamLimitEntity21.mon_amt" data-options="precision:2,decimalSeparator:'.',min:0,max:9999999999.99" value="${appInsParamLimitEntity21.mon_amt}"></input></td>
                    </tr>
                </table>
            </div>
            <div style="text-align:center;padding:5px">
                <%--<a href="javascript:void(0)" class="easyui-linkbutton btn detail-remove" iconCls="icon-save" id="saveBtn">保存</a>--%>
                    <c:if test="${insLevel == '1' ||  (insLevel != '1' && insUuid != ins_uuid)}">
                        <jiepos:buttonDetailTag menuCode="${menuCode}" buttonCode="INSSERVPARM_BTN_SAVE" hideBack="true" formId="insServiceParamForm"></jiepos:buttonDetailTag>
                    </c:if>
            </div>
            <!-- 隐藏部分 -->
            <div class="easyui-panel hide">
                <input type="hidden" name="appInsParamLimitEntity12.signal_minamt"  value="${appInsParamLimitEntity12.signal_minamt}"/>
                <input type="hidden" name="appInsParamLimitEntity12.signal_maxamt"  value="${appInsParamLimitEntity12.signal_maxamt}"/>
                <input type="hidden" name="appInsParamLimitEntity12.signal_card_interval"  value="${appInsParamLimitEntity12.signal_card_interval}"/>
                <input type="hidden" name="appInsParamLimitEntity12.signal_card_num"  value="${appInsParamLimitEntity12.signal_card_num}"/>
                <input type="hidden" name="appInsParamLimitEntity12.signal_card_amt"  value="${appInsParamLimitEntity12.signal_card_amt}"/>
                <input type="hidden" name="appInsParamLimitEntity12.signal_card_mon_num"  value="${appInsParamLimitEntity12.signal_card_mon_num}"/>
                <input type="hidden" name="appInsParamLimitEntity12.signal_card_mon_amt"  value="${appInsParamLimitEntity12.signal_card_mon_amt}"/>
                <input type="hidden" name="appInsParamLimitEntity12.day_num"  value="${appInsParamLimitEntity12.day_num}"/>
                <input type="hidden" name="appInsParamLimitEntity12.day_amt"  value="${appInsParamLimitEntity12.day_amt}"/>
                <input type="hidden" name="appInsParamLimitEntity12.mon_num"  value="${appInsParamLimitEntity12.mon_num}"/>
                <input type="hidden" name="appInsParamLimitEntity12.mon_amt"  value="${appInsParamLimitEntity12.mon_amt}"/>
                <input type="hidden" name="appInsParamLimitEntity22.signal_minamt"  value="${appInsParamLimitEntity22.signal_minamt}"/>
                <input type="hidden" name="appInsParamLimitEntity22.signal_maxamt"  value="${appInsParamLimitEntity22.signal_maxamt}"/>
                <input type="hidden" name="appInsParamLimitEntity22.signal_card_interval"  value="${appInsParamLimitEntity22.signal_card_interval}"/>
                <input type="hidden" name="appInsParamLimitEntity22.signal_card_num"  value="${appInsParamLimitEntity22.signal_card_num}"/>
                <input type="hidden" name="appInsParamLimitEntity22.signal_card_amt"  value="${appInsParamLimitEntity22.signal_card_amt}"/>
                <input type="hidden" name="appInsParamLimitEntity22.signal_card_mon_num"  value="${appInsParamLimitEntity22.signal_card_mon_num}"/>
                <input type="hidden" name="appInsParamLimitEntity22.signal_card_mon_amt"  value="${appInsParamLimitEntity22.signal_card_mon_amt}"/>
                <input type="hidden" name="appInsParamLimitEntity22.day_num"  value="${appInsParamLimitEntity22.day_num}"/>
                <input type="hidden" name="appInsParamLimitEntity22.day_amt"  value="${appInsParamLimitEntity22.day_amt}"/>
                <input type="hidden" name="appInsParamLimitEntity22.mon_num"  value="${appInsParamLimitEntity22.mon_num}"/>
                <input type="hidden" name="appInsParamLimitEntity22.mon_amt"  value="${appInsParamLimitEntity22.mon_amt}"/>
                <input type="hidden" name="appInsParamLimitEntity11.signal_card_interval"  value="${appInsParamLimitEntity11.signal_card_interval}"/>
                <input type="hidden" name="appInsParamLimitEntity11.signal_card_num"  value="${appInsParamLimitEntity11.signal_card_num}"/>
                <input type="hidden" name="appInsParamLimitEntity11.signal_card_amt"  value="${appInsParamLimitEntity11.signal_card_amt}"/>
                <input type="hidden" name="appInsParamLimitEntity11.signal_card_mon_num"  value="${appInsParamLimitEntity11.signal_card_mon_num}"/>
                <input type="hidden" name="appInsParamLimitEntity11.signal_card_mon_amt"  value="${appInsParamLimitEntity11.signal_card_mon_amt}"/>
                <input type="hidden" name="appInsParamLimitEntity21.signal_card_interval"  value="${appInsParamLimitEntity21.signal_card_interval}"/>
                <input type="hidden" name="appInsParamLimitEntity21.signal_card_num"  value="${appInsParamLimitEntity21.signal_card_num}"/>
                <input type="hidden" name="appInsParamLimitEntity21.signal_card_amt"  value="${appInsParamLimitEntity21.signal_card_amt}"/>
                <input type="hidden" name="appInsParamLimitEntity21.signal_card_mon_num"  value="${appInsParamLimitEntity21.signal_card_mon_num}"/>
                <input type="hidden" name="appInsParamLimitEntity21.signal_card_mon_amt"  value="${appInsParamLimitEntity21.signal_card_mon_amt}"/>
            </div>
        </form>
    </div>
</div>